package com.cy.pj.sys.controller;

import java.util.Map;

import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cy.pj.common.bo.JsonResult;
import com.cy.pj.sys.service.SysLogService;

/**
 * 在这个controller中做处理日志请求
 * @author private
 *
 */
@Controller

@RequestMapping("/log/")
public class SysLogController {
	@Autowired
	private SysLogService sysLogService;
	
	@RequestMapping("doDeleteObject")
	@ResponseBody
	public JsonResult doDeleteObject(Integer... ids) {
		sysLogService.deleteObjects(ids);
		return new JsonResult("delete ok");
	}
	
	@RequestMapping("doFindPagesObjects")
	@ResponseBody
	public JsonResult doFindPagesObjects(Long pageCurrent,String username){
//		try {
		return new JsonResult(sysLogService.findPageObjects(pageCurrent, username));			
//		}catch (Exception e) {
//			return new JsonResult(e);
//		}
	}
	//一个项目中很多的包(很多的项目,是下个阶段的负载均衡吗?)
	//在controller内部也可以定义异常处理方法,但不常用
//	@ExceptionHandler(RuntimeException.class)
//	@ResponseBody
//	public JsonResult doHandlerRuntimeException(RuntimeException e) {
//		return new JsonResult(e);
//	}
}
